import { get } from "../mock";

import request from "@/utils/request";
import { AxiosPromise } from "axios";
import {
  WordComForms,
  WordComQuery,
  WordComPageVO,
  WordComPageResult,
} from "./types";

/**
 * 获取分页数据
 *
 * @param queryParams
 */
export function getWordComPage(
  queryParams?: WordComQuery
): AxiosPromise<WordComPageResult> {
  return request({
    url: "/api/wordLearn/select",
    method: "get",
    params: queryParams,
  });
}

/**
 * 获取ID集合
 *
 * @param queryParams
 */
export function getWordComMenuIds(id: string): AxiosPromise<string[]> {
  return request({
    url: "/api/work/find",
    method: "get",
  });
}

/**
 * 修改
 *
 * @param id
 * @param data
 */
export function updateWordCom(word: string, data: WordComForms) {
  return request({
    url: "/api/wordLearn/flag",
    method: "put",
    data: data,
  });
}

/**
 * 获取用户ID集合
 *
 * @param queryParams
 */
export function getUserIds(ids: string): AxiosPromise<number[]> {
  return request({
    url: "/api/sys/user/info",
    method: "get",
  });
}
